home *** CD-ROM | disk | FTP | other *** search
- Path: longwood.cs.ucf.edu!not-for-mail
- From: stevens@longwood.cs.ucf.edu (John Stevens)
- Newsgroups: comp.lang.c++
- Subject: Re: Visual C++ 4.0 lacking initializers?
- Date: 24 Jan 1996 10:03:50 -0500
- Organization: University of Central Florida
- Message-ID: <4e5hom$h0p@longwood.cs.ucf.edu>
- References: <31049C46.A26@oz.is>
- NNTP-Posting-Host: longwood.cs.ucf.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Hßlfdan Ingvarsson (halfdan@oz.is) wrote:
- : Is it me or is this sort of code not possible with VC++ 4.0?
-
- : // Declarations of class Foo
-
- : // VC++ Complains about the line below with the error
- : // error C2436: '__ctor' : cannot initialize member functions
- : Foo::Foo(void) : Foo::Foo(10) {}
-
- What are you trying to do here? You can initialize member variables by using
-
- Foo::Foo() : mData( 1 ) {} ;
-
- but what you have written would be inifinite recursion if it was allowed.
-
- Hope this helps,
- John S.
-
-